#pragma once

#include "../layout/layout.hpp"
#include "./components.hpp"

namespace qbe::select {

struct RenderOverallModel {
  vsg::ref_ptr<layout::CellMeshs> nodes;
  vsg::ref_ptr<layout::CellMeshs> hover_nodes;
  vsg::ref_ptr<layout::renders::GeoMeshNode> draw_box_node;

  //part
  // vsg::ref_ptr<render::MeshNode> hover_edge_node;
  // vsg::ref_ptr<render::MeshNode> hover_point_node;
  // vsg::ref_ptr<render::MeshNode> select_edge_node;
  // vsg::ref_ptr<render::MeshNode> select_point_node;

  vsg::ref_ptr<layout::renders::GeoMeshNode> hover_edge_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> hover_point_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> select_edge_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> select_point_node;

  // algin
  // vsg::ref_ptr<render::MeshNode> algin_select_edge_node;
  // vsg::ref_ptr<render::MeshNode> algin_select_point_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> algin_select_edge_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> algin_select_point_node;

  // geo
  vsg::ref_ptr<layout::renders::GeoMeshNode> hover_flyline_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> select_flyline_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> hover_pin_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> select_pin_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> hover_keypoint_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> select_keypoint_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> hover_ruler_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> select_ruler_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> hover_view3d_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> select_view3d_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> hover_section3d_node;
  vsg::ref_ptr<layout::renders::GeoMeshNode> select_section3d_node;

  struct RulerTag {};
  struct View3DTag {};
  struct Section3DTag {};
  struct PinTag {};
  struct KeyPointTag {};
  struct FlyLineTag {};
};

struct RenderSelectBoxModel {
  vsg::ref_ptr<render::MeshNode> node;
};

// void select_render_init(ecs::Query query);
// void select_render_update(ecs::Query query);

// void select_part_render_init(ecs::Query query);
// void select_part_render_update(ecs::Query query);

// void select_box_render_init(ecs::Query query);
// void select_box_render_update(ecs::Query query);

class RenderSelectPlugin : public ecs::Plugin {
 public:
  void build(ecs::App& app) override;
};

}  // namespace qbe::select